package objectOriented

object SimpleObject {
  def main(args: Array[String]): Unit = {
    val person = new People()
    person.name = "aqie"
    println(person.eat())
    person.printGender()
  }
}

class People{
  var name:String = _      // 用占位符必须声明类型，而且是变量
  val age:Int = 10        // 常量自动生成get , 变量生成get/set
  private [this] val gender = "female"      // private [this] 修饰只能在class内被访问

  def eat() :String = {
    name + " eating"
  }

  def printGender(): Unit ={
    println("gender: " + gender)
  }
}